package team.yidong.fenda.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import team.yidong.fenda.entity.KnowledgeImg;

import java.util.List;

/**
 * Created by xuanlong on 2018/3/7.
 */
@Repository
public interface KnowLedgeImgRepository extends JpaRepository<KnowledgeImg, Integer> {
    @Query("select img.imgPath from KnowledgeImg img where img.knowledgeId=?1")
    List<String> findKnowLedgeImgPathList(Integer knowLedgeId);

    @Query("select img from KnowledgeImg img where img.knowledgeId=?1 and img.status='use'")
    List<KnowledgeImg> findByKnowledgeId(Integer knowledgeId);
}
